package main;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import iterator.IterativeRanker;
import data.DataManager;
import data.Game;
import data.Player;
import data.generators.XMLGenerator;

public class ConsoleMain {
	public static void printGames(Game [] games){
		for (int i = 0; i < games.length; i++) {
			System.out.println(games[i]);
		}
	}
	public static void printPlayers(Player [] players){
		for (int i = 0; i < players.length; i++) {
			System.out.println(players[i]);
		}
	}
	public static void main(String[] args) {
//		DataGenerator generator = new DummyData();
		DataManager manager;
		try {
			manager = new DataManager(new XMLGenerator());
			printGames(manager.getGames());
			IterativeRanker iterator = new IterativeRanker(manager);
			iterator.start();
			iterator.printRanks();
		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		} catch (SAXException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}
